package com.yjz.designpattern.访问者模式;

/**
 * 具体元素：水果 可以被访问
 */
class Fruit implements Element {
    private double pricePerKg;
    private double weight;

    public Fruit(double pricePerKg, double weight) {
        this.pricePerKg = pricePerKg;
        this.weight = weight;
    }

    public double getPricePerKg() {
        return pricePerKg;
    }

    public double getWeight() {
        return weight;
    }

    @Override
    public void accept(Visitor visitor) {
        visitor.visit(this);
    }
}